package com.system.appointment.bean;

import jakarta.persistence.*;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @className: Queue
 * @description: 数据库持久层对象
 * @author: Kuangkeli
 * @date: 2023/11/27 18:56
 **/
@Data
public class Queue {
    private Integer QueueId;

    /**
     * 号源池明细编号
     */
    private Integer poollstId;

    /**
     * 预约单据编号
     */
    private Integer appointmentId;

    /**
     * 医生编号
     */
    private Integer employeeId;

    /**
     * 诊室编号
     */
    private Integer consultationId;

    /**
     * 序列时间
     */
    private LocalDateTime serialtm;

    /**
     * 入队时间
     */
    private LocalDateTime enqueuetm;

    /**
     * 出队时间
     */
    private LocalDateTime dequeuetm;

    /**
     * 呼叫次数
     */
    private Long callnum;


    /**
     * 状态:0不可用,1可用
     */
    @Column(columnDefinition = "integer default 1")
    private Integer state = 1;

    /**
     * 创建后加入队列
     */
    @PrePersist
    protected void onCreate() {
        enqueuetm = LocalDateTime.now();
    }

}
